<div class="nav">
    <a class="sel" href="{:U('index')}">余额修改</a>
</div>
<div class="add">
    <form method="post" action="" onsubmit="return checkform()" >
        <table class="table_add" cellpadding='8'>
            <tr>
                <td width="100px">会员名称</td>
                <td style="line-height:26px;"><input type="text" name="username" id="username" value="" /> <label class="msg">请输入用户名\手机\邮箱</label></td>
            </tr>
            <tr>
                <td></td><td>
                    <div id="user_message" class="msg">会员查询结果显示这里</div>
                </td>
            </tr>
            <tr>
                <td>修改的余额</td>
                <td style="line-height:26px;">
                    <select name="money_type" id="money_type" class="sel1">
                        <option value="+">增加</option>
                        <option value="-">减少</option>
                    </select>
                    <input type="text" name="money" id="money" class="input1" style="width:50px" value="" />&nbsp;&nbsp;
                    备注：
                    <input type="text" name="remark" id="remark" value="" class="input1" /> <label class="msg">必填</label>
                </td>
            </tr>
            <tr>
                <td></td>
                <td style="line-height:26px;"><input class="btn1" type="submit" value="提交" /></td>
            </tr>
        </table>
    </form>
</div>
<script type="text/javascript" >
    //会员名称检测
    var check_url = '{:U('get_member_message')}';
    $("#username").blur(function() {
       $("#user_message").html('查找中...');
       var username = $("#username").val();
       $("#user_message").load(check_url+'?username='+encodeURI(username)); 
    });
    //表单提交检测
    function checkform() {
       var username = $.trim($("#username").val());
       var money = $.trim($("#money").val());
       var remark = $.trim($("#remark").val());
       if(username == '') {
           alert('请输入用户名！'); 
           $("#username").focus();
           return false;
       }
       if(money == '') {
           alert('请输入余额值！'); 
           $("#money").focus();
           return false;
       }
       if(remark == '') {
           alert('请输入备注！'); 
           $("#remark").focus();
           return false;
       }
    }
</script>
